#include "rtc_stream.h"

namespace xrtc {

RtcStream::RtcStream(EventLoop *el, PortAllocator* allocator, uint64_t uid, const std::string &stream_name, 
                     bool audio, bool video, uint32_t log_id) 
                    : m_el(el), m_uid(uid), m_stream_name(stream_name)
                    , m_audio(audio), m_video(video), m_log_id(log_id)
                    , m_pc(std::make_unique<PeerConnection>(el, allocator )) {
}

int RtcStream::start(rtc::RTCCertificate* certificate) {
    return m_pc->init(certificate);
}

void RtcStream::set_remote_sdp(const std::string &sdp) {
    m_pc->set_remote_sdp(sdp);
}

}